package com.travel.dao;

import com.travel.domain.Product;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ProductDao {

    @Select("select * from product")
    List<Product> findAll();


    @Insert("insert into PRODUCT (productnum, productname, cityname, departuretime, productprice,\n" +
            "productdesc, productstatus)\n" +
            "values ( #{productNum},#{productName}," +
            "#{cityName},#{departureTime},#{productPrice},#{productDesc},#{productStatus}" +
            ")")
    void saveProduct(Product product);


    @Select("select * from product where id=#{id}")
    Product findById(String id);
}
